package com.cyb.binojbackendjudgeservice.controller.inner;

import com.cyb.binojbackendjudgeservice.judge.JudgeService;
import com.cyb.binojbackendmodel.model.entity.QuestionSubmit;
import com.cyb.binojbackendserviceclient.service.JudgeFeginClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 该服务仅内部服务，不允许外部访问
 */
@RestController()
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeFeginClient {


    @Resource
    private JudgeService judgeService;

    /**
     * 判题
     *
     * @param questionSubmitId
     * @return
     */
    @PostMapping("/do")
    @Override
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") long questionSubmitId){
        return judgeService.doJudge(questionSubmitId);
    };
}
